var gulp = require('gulp');
var gulpif = require('gulp-if');
var rev = require('gulp-rev');
var revCollector = require('gulp-rev-collector');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var livereload = require('gulp-livereload');
var config = require('../config').js;
var configDes = require('../config').des;
var amdOptimize = require("amd-optimize"); 

gulp.task('scripts', function () {
    return gulp.src(config.src)
//      .pipe(amdOptimize('main', {
//        configFile: configDes + '/js/main.js',
//        findNestedDependencies: true,
//        include: false
//      }))
//      .pipe(concat('all.js'))
//      .pipe(gulpif('!hebicollector-*.js', uglify()))
//      .pipe(gulpif(global.isProd, rev()))
        .pipe(gulp.dest(config.dest))
//      .pipe(gulpif(global.isProd, rev.manifest()))
//      .pipe(gulpif(global.isProd, gulp.dest(config.rev)))
        .pipe(livereload())
});